package com.example.demo.math;

public class Demo {

    public int Fei(int n){
        // f(n) = f(n-1) + f(n-2)

        int [] dp = new int[n+1];
        for(int i = 1 ;i<=n;i++){
            if(i <=2){
                dp[i] = i;
            }else {
                dp[i] = dp[i-2] + dp[i-1];
            }
        }
        return dp[n];
    }
}


class Test{

    public static void main(String[] args) {
        Demo d = new Demo();
        System.out.println(d.Fei(10));
    }
}